home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Mac Game Programming Gurus / TricksOfTheMacGameProgrammingGurus.iso / Information / CSMP Digest / volume 1 / csmp-v1-124.txt < prev    next >
Encoding:
Text File  |  1994-12-08  |  43.3 KB  |  1,160 lines  |  [TEXT/R*ch]

  1. C.S.M.P. Digest             Fri, 26 Jun 92       Volume 1 : Issue 124
  2.  
  3. Today's Topics:
  4.  
  5.     Programming Question
  6.     THINK Pascal Random Numbers
  7.     Choosing a file at random.
  8.     Motif programming- guides for Macintosh programmers
  9.     Problem with C++ example code
  10.     Technical Notes
  11.     PBHCopyFile equivalent for non-shared environments?
  12.     what's an OO-OS?
  13.     SFGetFile quick question!!!
  14.     Pascal stuff for sale
  15.     A Couple of Strange Things About Think Pascal 4.01
  16.  
  17.  
  18. The Comp.Sys.Mac.Programmer Digest is moderated by Michael A. Kelly.
  19.  
  20. These digests are available (by using FTP, account anonymous, your email
  21. address as password) in the pub/mac/csmp-digest directory on ftp.cs.uoregon.
  22. edu.  This is also the home of the comp.sys.mac.programmer Frequently Asked
  23. Questions list.  The last several issues of the digest are available from
  24. sumex-aim.stanford.edu as well.
  25.  
  26. These digests are also available via email.  Just send a note saying that you
  27. want to be on the digest mailing list to mkelly@cs.uoregon.edu, and you will
  28. automatically receive each new digest as it is created.
  29.  
  30. The digest is a collection of articles from the internet newsgroup comp.sys.
  31. mac.programmer.  It is designed for people who read c.s.m.p. semi-regularly
  32. and want an archive of the discussions.  If you don't know what a newsgroup
  33. is, you probably don't have access to it.  Ask your systems administrator(s)
  34. for details.  (This means you can't post questions to the digest.)
  35.  
  36. The articles in these digests are taken directly from comp.sys.mac.programmer.
  37. They are not edited; all articles included in this digest are in their original
  38. posted form.  The only articles that are -not- included in these digests are
  39. those which didn't receive any replies (except those that give information
  40. rather than ask a question).  All replies to each article are concatenated
  41. onto the original article in the order in which they were received.  Article
  42. threads are not added to the digests until the last article added to the
  43. thread is at least one month old (this is to ensure that the thread is dead
  44. before adding it to the digests).
  45.  
  46. Send administrative mail to mkelly@cs.uoregon.edu.
  47.  
  48. -------------------------------------------------------
  49.  
  50. From: sjones@cygnusx1.cs.utk.edu (Stephen Jones)
  51. Subject: Programming Question
  52. Date: 11 May 92 14:01:09 GMT
  53. Organization: University of Tennessee, Knoxville
  54.  
  55. Thanks to all those who responded to my first query.
  56.   More Questions :
  57.  
  58. 1. How would one go about displaying a push button in color ?  I have a
  59. client who wants a green, a red and a black push button to be displayed
  60. on the screen together.  Is this possible, and/or does anyone have any
  61. ideas ?  Is this an Apple Interface Guideline violation ?
  62.  
  63. 2. Has anyone experienced a peculiar error on the Classic II (or any
  64. other machine for that matter) where SFPutFile, and SFGetFile will work
  65. from the hard drive but not from a floppy drive ? Once the error occurs
  66. no future calls to either one of these traps will work from the hard
  67. drive or the floppy.  After it occurs, no application that uses these
  68. calls will work.  They crash with an "unknown" error.  The system
  69. attempts to display the dialog and crashes in the process of doing so. 
  70. Any ideas would be greatly appreciated. 
  71.  
  72.                              Thanks in advance,
  73.                                    Stephen Jones
  74.  
  75. +++++++++++++++++++++++++++
  76.  
  77. From: k044477@hobbes.kzoo.edu (Jamie R. McCarthy)
  78. Organization: Kalamazoo College
  79. Date: Mon, 11 May 1992 17:38:29 GMT
  80.  
  81. sjones@cygnusx1.cs.utk.edu (Stephen Jones) writes:
  82. >
  83. >1. How would one go about displaying a push button in color ?  I have a
  84. >client who wants a green, a red and a black push button to be displayed
  85. >on the screen together.  Is this possible, and/or does anyone have any
  86. >ideas ?  Is this an Apple Interface Guideline violation ?
  87.  
  88. It's "legal" if (1) color is not the only means by which any information
  89. is conveyed, and (2) colorblind people can distinguish the colors as
  90. easily as noncolorblind people.  Read IM V, ch. 2, for a good discussion
  91. of colorblindness.
  92.  
  93. And yes, it's possible.  But it looks ugly as sin, especially with the
  94. standard Apple push buttons.  If it were me, I'd at least make the
  95. colored buttons different-looking somehow.  But if you must, read IM V,
  96. ch. 12, to see how to do it.
  97. - -- 
  98.  Jamie McCarthy     Internet: k044477@kzoo.edu     AppleLink: j.mccarthy
  99.  Ceci n'est pas une .signature.
  100.  
  101. +++++++++++++++++++++++++++
  102.  
  103. From: ivanski@world.std.com (Ivan M CaveroBelaunde)
  104. Organization: The World Public Access UNIX, Brookline, MA
  105. Date: Tue, 12 May 1992 01:33:39 GMT
  106.  
  107. k044477@hobbes.kzoo.edu (Jamie R. McCarthy) writes:
  108. >sjones@cygnusx1.cs.utk.edu (Stephen Jones) writes:
  109. >>
  110. >>1. How would one go about displaying a push button in color ?  I have a
  111. >>client who wants a green, a red and a black push button to be displayed
  112. >>on the screen together.  Is this possible, and/or does anyone have any
  113. >>ideas ?  Is this an Apple Interface Guideline violation ?
  114. >It's "legal" if (1) color is not the only means by which any information
  115. >is conveyed, and (2) colorblind people can distinguish the colors as
  116. >easily as noncolorblind people.  Read IM V, ch. 2, for a good discussion
  117. >of colorblindness.
  118.  
  119. Additionally,from your descriptin,I think it's a bad idea. Somewhere in
  120. Apple's UI docs is a discussion specifically about using red and green
  121. in their symbolic forms (red=bad, green=good), so that the "Yes" button
  122. in "Do you really want to reformat your hard disk?" dialog would be red,
  123. and the "No" button green. Trouble is, they found out that red is especially
  124. bright and attracts attention to itself, thus making it worse for the
  125. inexperienced user. Since you specifically mention red and green, I assume
  126. that it's this kind of situation.
  127.  
  128. Sorry about the incoherence of the post, but I'm tired and jetlagged and
  129. running on no sleep.
  130.  
  131. - ---
  132. - -Ivan Cavero Belaunde
  133. DiVA Corporation
  134.  
  135. ivanski@world.std.com
  136.  
  137.  
  138.  
  139. +++++++++++++++++++++++++++
  140.  
  141. From: jpugh@apple.com (Jon Pugh)
  142. Date: 13 May 92 05:50:40 GMT
  143. Organization: Apple Computer, Inc.
  144.  
  145. In article <Bo4705.JLs@world.std.com>, ivanski@world.std.com (Ivan M CaveroBelaunde) writes:
  146. > k044477@hobbes.kzoo.edu (Jamie R. McCarthy) writes:
  147. > >sjones@cygnusx1.cs.utk.edu (Stephen Jones) writes:
  148. > >>
  149. > >>1. How would one go about displaying a push button in color ?  I have a
  150. > >>client who wants a green, a red and a black push button to be displayed
  151. > >>on the screen together.  Is this possible, and/or does anyone have any
  152. > >>ideas ?  Is this an Apple Interface Guideline violation ?
  153. > >It's "legal" if (1) color is not the only means by which any information
  154. > >is conveyed, and (2) colorblind people can distinguish the colors as
  155. > >easily as noncolorblind people.  Read IM V, ch. 2, for a good discussion
  156. > >of colorblindness.
  157. > Additionally,from your descriptin,I think it's a bad idea. Somewhere in
  158. > Apple's UI docs is a discussion specifically about using red and green
  159. > in their symbolic forms (red=bad, green=good), so that the "Yes" button
  160. > in "Do you really want to reformat your hard disk?" dialog would be red,
  161. > and the "No" button green. Trouble is, they found out that red is especially
  162. > bright and attracts attention to itself, thus making it worse for the
  163. > inexperienced user. Since you specifically mention red and green, I assume
  164. > that it's this kind of situation.
  165.  
  166. I think an additional reason against this sort of color coding (if that is
  167. really what you are doing) is that other cultures associate different meanings
  168. to the common red & green which we see in traffic lights every day.
  169.  
  170. I seem to recall reading this in an HI document somewhere sometime.
  171.  
  172. Jon
  173.  
  174. +++++++++++++++++++++++++++
  175.  
  176. From: macknik@wiliki.eng.hawaii.edu (Elizabeth Macknik)
  177. Organization: University of Hawaii, College of Engineering
  178. Date: Mon, 25 May 1992 13:16:13 GMT
  179.  
  180. In article <Bo4705.JLs@world.std.com> ivanski@world.std.com (Ivan M CaveroBelaunde) writes:
  181. >k044477@hobbes.kzoo.edu (Jamie R. McCarthy) writes:
  182. >>sjones@cygnusx1.cs.utk.edu (Stephen Jones) writes:
  183. >>>
  184. >>>1. How would one go about displaying a push button in color ?  I have a
  185. >>>client who wants a green, a red and a black push button to be displayed
  186. >>>on the screen together.  Is this possible, and/or does anyone have any
  187. >>>ideas ?  Is this an Apple Interface Guideline violation ?
  188.  
  189. >>It's "legal" if (1) color is not the only means by which any information
  190. >>is conveyed, and (2) colorblind people can distinguish the colors as
  191. >>easily as noncolorblind people.  Read IM V, ch. 2, for a good discussion
  192. >>of colorblindness.
  193. >
  194. >Additionally,from your descriptin,I think it's a bad idea. Somewhere in
  195. >Apple's UI docs is a discussion specifically about using red and green
  196. >in their symbolic forms (red=bad, green=good), so that the "Yes" button
  197. >in "Do you really want to reformat your hard disk?" dialog would be red,
  198. >and the "No" button green. Trouble is, they found out that red is especially
  199. >bright and attracts attention to itself, thus making it worse for the
  200. >inexperienced user. Since you specifically mention red and green, I assume
  201. >that it's this kind of situation.
  202.  
  203. Since the most common form of colorblindness is red-green colorblindness,
  204. these two colors are a particularly bad choice to differentiate tasks.
  205. Don't rely on your users being able to tell these colors apart.
  206.  
  207. However, remember that the Apple UI is a guide for making your programs
  208. consistent and understandable to most users.  If you have a specialized
  209. group of users and a very important reason for not following the
  210. guidelines, it can improve your program.
  211.  
  212. For example, if I was running a simulation of a piece of equipment that
  213. had red and green buttons, I would want those buttons to be the same
  214. color on the Mac; especially if the program was written to train users
  215. about some aspect of the equipment.  Since the users would already be
  216. familiar with the equipment, or need to become familiar with it through
  217. initial training on a Mac, it would not be wrong to violate the UI to
  218. emulate the equipment.
  219.  
  220. This works in any situation where you have a group of users who you can
  221. assume has a certain set of knowledge.  But, If you are not absolutely sure
  222. that your user base has that knowledge--assume they don't!  Usually this
  223. will only apply in a custom programming environment, if you are programming
  224. for the general public, stick to the UI.
  225.  
  226.  
  227.  
  228. ---------------------------
  229.  
  230. From: eebonar@sn01.sncc.lsu.edu (DAVID BONAR)
  231. Subject: THINK Pascal Random Numbers
  232. Organization: News and Views from LSU
  233. Date: Wed, 13 May 1992 19:54:53 GMT
  234.  
  235.  
  236.     I'm attempting to write a Monte Carlo engine for various simulation
  237. purposes.  However, I have not found a way to get a reasonable random number
  238. from THINK Pascal.  The manuals seem worthless for this (or I can't find it
  239. if they have a mention) and I do not have access to Inside Mac or the like.
  240. I'm looking for a means of getting a random sequence of numbers that does not 
  241. need to be seeded each time (such as a routine based on the clock).
  242.  
  243. Dave
  244. __________
  245. Dave Bonar
  246. eebonar@lsuvax.sncc.lsu.edu
  247. __________
  248.  
  249.  
  250. +++++++++++++++++++++++++++
  251.  
  252. From: lipa@camis.Stanford.EDU (Bill Lipa)
  253. Date: 13 May 92 22:38:35 GMT
  254. Organization: Stanford School of Medicine
  255.  
  256.  
  257. There is a random number generator provided as part of the Toolbox (it is
  258. called Random() and for some reason is in Inside Macintosh I under QuickDraw).
  259. However, as I have never read anything about the quality or speed of this
  260. generator, I would recommend that you write your own. It is very easy to do.
  261. Knuth vol. 2 has an interesting chapter about how to do it properly.
  262.  
  263. One interesting and fast generator he discusses is on p. 26. It doesn't
  264. require any multiplications.
  265.  
  266. I am not clear on what you meant by
  267. > I'm looking for a means of getting a random sequence of numbers that does not
  268. > need to be seeded each time (such as a routine based on the clock).
  269.  
  270. Why is it important whether or not the routine needs to be seeded?
  271.  
  272. Bill
  273. lipa@camis.stanford.edu
  274.  
  275. +++++++++++++++++++++++++++
  276.  
  277. From: fry@zariski.harvard.edu (David Fry)
  278. Date: 14 May 92 07:46:43 GMT
  279. Organization: Harvard Math Department
  280.  
  281. In article <1992May13.223835.17431@morrow.stanford.edu> lipa@camis.Stanford.EDU (Bill Lipa) writes:
  282. >
  283. >There is a random number generator provided as part of the Toolbox (it is
  284. >called Random() and for some reason is in Inside Macintosh I under QuickDraw).
  285. >However, as I have never read anything about the quality or speed of this
  286. >generator, I would recommend that you write your own. It is very easy to do.
  287. >Knuth vol. 2 has an interesting chapter about how to do it properly.
  288.  
  289. It seems like I post this once a month, but...
  290.  
  291. While the Knuth chapter is indeed fantastic, the Mac's RNG is quite 
  292. good.  It is based on the routine described in "Random Number
  293. Generators: Good Ones are Hard to Find" by Park and Miller in
  294. Communications of the ACM, October 1988.  This article has a lot to
  295. say about RNG, and why this one, which they call the "minimal
  296. standard," is adequate for most purposes.
  297.  
  298. To be precise, Random() uses the lower 16 bits of the full 32-bit long
  299. word used by the minimal standard.  However, you can get the full
  300. 32 bits by ignoring the result of Random(), and using randSeed as your
  301. random number.
  302.  
  303. Also, I wrote my own (unoptimized) version of the same routine in THINK C, 
  304. and while it gave the same results as Random(), Apple's Random() was
  305. much faster.  So, why re-invent the wheel?  Let them do the work for you.
  306.  
  307. David Fry                               fry@math.harvard.EDU
  308. Department of Mathematics               fry@huma1.bitnet
  309. Harvard University                      ...!harvard!huma1!fry
  310. Cambridge, MA  02138            
  311.  
  312. +++++++++++++++++++++++++++
  313.  
  314. From: greeny@top.cis.syr.edu (J. S. Greenfield)
  315. Organization: Syracuse University, CIS Dept.
  316. Date: Fri, 15 May 92 01:41:33 EDT
  317.  
  318.  
  319. >There is a random number generator provided as part of the Toolbox (it is
  320. >called Random() and for some reason is in Inside Macintosh I under QuickDraw).
  321. >However, as I have never read anything about the quality or speed of this
  322. >generator, I would recommend that you write your own. It is very easy to do.
  323. >Knuth vol. 2 has an interesting chapter about how to do it properly.
  324.  
  325. Better yet, check out
  326.  
  327. S. Park and K. Miller, "Random Number Generators: Good ones are hard to find,"
  328. CACM, 31:10 (October, 1988).
  329.  
  330. If you want to do any serious simulation, then you need to be very careful
  331. about selecting a random number generator.  Park and Miller have done all
  332. the work for you (unless you are writing a simulation that requires
  333. billions of pseudo-independent random events), and their paper will be
  334. far easier to handle than Knuth's stuff.  (They both use the same type
  335. of generator anyway--a "multiplicative linear congruential generator.")
  336.  
  337. >One interesting and fast generator he discusses is on p. 26. It doesn't
  338. >require any multiplications.
  339.  
  340. In this day and age, I seriously doubt that this is of any real concern.
  341. Remember that Knuth's stuff dates back to the late sixties.
  342.  
  343. >I am not clear on what you meant by
  344. >> I'm looking for a means of getting a random sequence of numbers that does not
  345. >> need to be seeded each time (such as a routine based on the clock).
  346. >
  347. >Why is it important whether or not the routine needs to be seeded?
  348.  
  349. It is probably *not* a good idea to avoid using your own seed, at least at
  350. the outset.  Taking advantage of the deterministic nature of the
  351. psuedo-random number generator (when an identical seed is used) can be an
  352. important tool for debugging simulations.  If you use a varying seed, you
  353. lose reproducibility (of some errors).
  354.  
  355. Later, you can always write a simple routine to check the clock and create
  356. a "random" initial seed each time you run the simulation.
  357.  
  358. Good luck!
  359.  
  360. - -- 
  361. J. S. Greenfield                                         greeny@top.cis.syr.edu
  362. (I like to put 'greeny' here, 
  363. but my d*mn system wants a 
  364. *real* name!)                        "What's the difference between an orange?"
  365.  
  366. +++++++++++++++++++++++++++
  367.  
  368. From: ksand@apple.com (Kent Sandvik)
  369. Date: 17 May 92 22:56:25 GMT
  370. Organization: MacDTS Mongols
  371.  
  372. In article <1992May14.034644.12279@husc3.harvard.edu>, fry@zariski.harvard.edu
  373. (David Fry) writes:
  374. > In article <1992May13.223835.17431@morrow.stanford.edu>
  375. lipa@camis.Stanford.EDU (Bill Lipa) writes:
  376. > >
  377. > >There is a random number generator provided as part of the Toolbox (it is
  378. > >called Random() and for some reason is in Inside Macintosh I under
  379. QuickDraw).
  380. > >However, as I have never read anything about the quality or speed of this
  381. > >generator, I would recommend that you write your own. It is very easy to do.
  382. > >Knuth vol. 2 has an interesting chapter about how to do it properly.
  383.  
  384. > Also, I wrote my own (unoptimized) version of the same routine in THINK C, 
  385. > and while it gave the same results as Random(), Apple's Random() was
  386. > much faster.  So, why re-invent the wheel?  Let them do the work for you.
  387.  
  388. Yes, I also had the assumption that a memory-based routine is faster than
  389. a trap call (Random), I wrote some test code and the difference was so minimal
  390. it's not worth implementing. The only reason one might write another Random
  391. routine is for a particual random implementation concerning the quality of 
  392. random values (or as Knuth stated, a Random number is not random).
  393.  
  394. I placed my quick C++ test hack on the Developer CD, it's also on the
  395. ftp.apple.com
  396. somewhere in the snippets directory. The other nice thing with this small C++
  397. class
  398. is that it shows how to switch algorithms/member functions using pointers to
  399. member functions.
  400.  
  401. Cheers,
  402. Kent/DTS
  403.  
  404. +++++++++++++++++++++++++++
  405.  
  406. From: jpugh@apple.com (Jon Pugh)
  407. Date: 18 May 92 00:53:22 GMT
  408. Organization: Apple Computer, Inc.
  409.  
  410. In article <25103@goofy.Apple.COM>, ksand@apple.com (Kent Sandvik) writes:
  411. > ... The only reason one might write another Random
  412. > routine is for a particual random implementation concerning the quality of 
  413. > random values (or as Knuth stated, a Random number is not random).
  414.  
  415. Not so.  The _real_ only reason to write one is for use in a code segment
  416. that doesn't have access to A5 globals, which Random calls.  Thus, if you
  417. do not call InitGraf, you cannot use Random!
  418.  
  419. Example code segments where this might be needed are INITs, cdevs & FKEYs.
  420.  
  421. Jon
  422.  
  423. particual - particular - close, but no R.
  424.  
  425. +++++++++++++++++++++++++++
  426.  
  427. From: ksand@apple.com (Kent Sandvik)
  428. Date: 18 May 92 01:33:12 GMT
  429. Organization: MacDTS Mongols
  430.  
  431. In article <25120@goofy.Apple.COM>, jpugh@apple.com (Jon Pugh) writes:
  432. > In article <25103@goofy.Apple.COM>, ksand@apple.com (Kent Sandvik) writes: 
  433. > > ... The only reason one might write another Random
  434. > > routine is for a particular random implementation concerning the quality of 
  435. > > random values (or as Knuth stated, a Random number is not random).
  436.  
  437. > Not so.  The _real_ only reason to write one is for use in a code segment
  438. > that doesn't have access to A5 globals, which Random calls.  Thus, if you
  439. > do not call InitGraf, you cannot use Random!
  440.  
  441. > Example code segments where this might be needed are INITs, cdevs & FKEYs.
  442.  
  443. I stand corrected, forgot InitGraf, actually I've seen problems where
  444. people forget to call InitGraf before using Random (like faceless
  445. background apps, which should call InitGraf anyway to initialize the 
  446. A5-world.
  447.  
  448. So feel free to use my C++ class for INITs :-). It's small enough so
  449. it could be a stack-based one, then again it takes some time to initialize
  450. it...
  451.  
  452.  
  453. Cheers,
  454. Kent
  455. PA: Jon, what are you doing at the office today (Sunday), go home.
  456.  
  457. +++++++++++++++++++++++++++
  458.  
  459. From: d88-jwa@byse.nada.kth.se (Jon W{tte)
  460. Date: 19 May 92 17:31:15 GMT
  461. Organization: Royal Institute of Technology, Stockholm, Sweden
  462.  
  463. > ksand@apple.com (Kent Sandvik) writes:
  464.  
  465.    PA: Jon, what are you doing at the office today (Sunday), go home.
  466.  
  467. He probably got so much flak for specification and targetting
  468. of AppleEvent destinations that he tries to do something about
  469. it ... NOT ! :-)
  470.  
  471. - -- 
  472. h++ - new and improved !
  473.  
  474. You never hide the menu bar. You might go about and make it the same
  475. color as the background, but you never hide the menu bar.      - Tog
  476.  
  477. +++++++++++++++++++++++++++
  478.  
  479. From: jpugh@apple.com (Jon Pugh)
  480. Date: 23 May 92 05:20:47 GMT
  481. Organization: Apple Computer, Inc.
  482.  
  483. In article <D88-JWA.92May19183115@byse.nada.kth.se>, d88-jwa@byse.nada.kth.se (Jon W{tte) writes:
  484. > > ksand@apple.com (Kent Sandvik) writes:
  485. >    PA: Jon, what are you doing at the office today (Sunday), go home.
  486. > He probably got so much flak for specification and targetting
  487. > of AppleEvent destinations that he tries to do something about
  488. > it ... NOT ! :-)
  489.  
  490. Actually, NewsWatcher runs great over ARA at 9600 baud.  I can read news from
  491. home now!
  492.  
  493. As for the Apple Event Manager, I didn't write it, don't have source code, and
  494. don't really care.  You want to talk suite definitions, we can rock.  I do
  495. like the T-shirt though.  Thanks, Jon!
  496.  
  497. Jon
  498.  
  499. ---------------------------
  500.  
  501. From: sjones@cygnusx1.cs.utk.edu (Stephen Jones)
  502. Subject: Choosing a file at random.
  503. Date: 21 May 92 13:28:25 GMT
  504. Organization: University of Tennessee, Knoxville
  505.  
  506.  
  507.   I'm writing an application that needs to search the directory in which
  508. it is located, find the number of files of OSTYPE = 'STOK' and choose
  509. one of them randomly.  How can my application find these files and Open
  510. them.  Specifically,  how would it query the file manager to see if the
  511. file type is the one being searched for, and how would it find the file
  512. name of the chosen file.
  513.  
  514.     I hope this makes sense . . . .
  515.                 a d v a  Thanks  n c e, 
  516.                                             Stephen Jones
  517.  
  518. +++++++++++++++++++++++++++
  519.  
  520. From: jpugh@apple.com (Jon Pugh)
  521. Date: 23 May 92 05:39:29 GMT
  522. Organization: Apple Computer, Inc.
  523.  
  524. In article <l1n9bpINNl12@utkcs2.cs.utk.edu>, sjones@cygnusx1.cs.utk.edu (Stephen Jones) writes:
  525. >   I'm writing an application that needs to search the directory in which
  526. > it is located, find the number of files of OSTYPE = 'STOK' and choose
  527. > one of them randomly.  How can my application find these files and Open
  528. > them.  Specifically,  how would it query the file manager to see if the
  529. > file type is the one being searched for, and how would it find the file
  530. > name of the chosen file.
  531.  
  532. Cycle through the files with PBGetCatInfo and count the ones with the correct
  533. type.  Then choose a random number in the correct range.  Finally, cycle
  534. through the files again and save the stats for the correct one.
  535.  
  536. Tough, huh?
  537.  
  538. Jon
  539.  
  540. ---------------------------
  541.  
  542. From: johnrobi@aludra.usc.edu (John Robinson)
  543. Subject: Motif programming- guides for Macintosh programmers
  544. Date: 21 May 1992 08:38:28 -0700
  545. Organization: University of Southern California, Los Angeles, CA
  546.  
  547. Does anyone know of a reference which compares X-windows programming
  548. to Macintosh programming?  I'm a Mac programmer bootstraping up into
  549. the Motif world.  I know that events are handled quite differently
  550. between Motif and the Mac; also, the Mac doesn't have anything called
  551. a callback procedure.  Resources on the Mac are built with an inexpensive
  552. resource editor called Resedit, which has a GUI; resources on Motif
  553. require editing huge text files, and things get more complicated
  554. because there are so many methods of building resource files (e.g. Wcl)
  555. which define their own callbacks.  I don't see the connection between
  556. the resources in these Wcl files and the applications they correspond to;
  557. ...
  558.  
  559. I get the feeling the Motif is more complex than the Mac (in that
  560. it handles multiple platforms simultaneaously, not in its functionality)
  561. but a side-by -side comparison of a sample application would get me going.
  562. Thanks.
  563.  
  564. JR
  565.  
  566. +++++++++++++++++++++++++++
  567.  
  568. From: hugh@rschp1.anu.edu.au (Hugh Fisher)
  569. Organization: Research School of Chemistry, ANU
  570. Date: Fri, 22 May 92 00:12:43 GMT
  571.  
  572.  
  573.   My $0.02 (Australian)... go for it, it is easier than you think.
  574.   This applies to other Macintosh programmers as well: you have
  575.   a head start over the Unix nerds when it comes to writing X
  576.   applications.
  577.  
  578.   (Disclaimer: I write Athena X Toolkit stuff, not Motif, but
  579.   this doesn't make much difference since they both work alike)
  580.  
  581.   To start, I'd recommend a book by Douglas A Young, "X Window
  582.   Systems Programming and Applications with Xt" which comes in
  583.   a Motif version. It shows you all the basic stuff of how to
  584.   write an application, how to handle menus, buttons, etc.
  585.  
  586.   As to the differences, programming in Motif is equivalent to
  587.   using MacApp on the Macintosh. The X Toolkit, which Motif is
  588.   derived from, is layered on top of the "raw" X API, Xlib, just
  589.   as MacApp is built on Quickdraw, the Event Manager, etc. If you
  590.   are more comfortable with writing your own event loops and so
  591.   on you should start with a book about Xlib.
  592.  
  593.   At this level, X looks very like the Macintosh. You open
  594.   windows, draw lines, bit-blit things around, and wait for
  595.   events to come in just as you do on the Mac. What X doesn't
  596.   have is built in menu managers, scrollbars, etc. These are
  597.   handled by the Toolkit.
  598.  
  599.   A toolkit such as Motif just takes care of all the hackwork
  600.   you have to write in any application: event loops, updates,
  601.   and so on. Callbacks are just the functions you would write
  602.   to handle menu choices, dialog items, etc in a Mac app. It
  603.   also provides basic building blocks like buttons and menus.
  604.  
  605.   In many ways, X applications are much cleaner than Macintosh
  606.   ones. The API and behaviour are identical for everything:
  607.   menus, commands, dialog items...none of the dialog hook vs
  608.   MDEF vs CDEF stuff you have to remember on the Macintosh.
  609.  
  610.   Resources...yeah, there are a lot of them. This is because the
  611.   X people couldn't hardcode the behaviour and appearance into
  612.   ROM and decree "this is how it will be" like Apple did. You
  613.   don't have to use them all though, a lot of applications get
  614.   by with the defaults that the toolkits supply.
  615.  
  616.   On the other hand, Motif does seem to suffer from bloat. A
  617.   popular .sig on the X newsgroups for a while was "While you
  618.   are reading this, Motif grew by a kilobyte" I'd suggest
  619.   starting with the Athena toolkit: smaller, and free.
  620.  
  621.     Hugh Fisher
  622.     hugh@rschp1.anu.edu.au
  623.  
  624. +++++++++++++++++++++++++++
  625.  
  626. From: sw@network-analysis-ltd.co.uk (Sak Wathanasin)
  627. Date: 25 May 92 10:04:50 GMT
  628. Organization: Network Analysis Ltd
  629.  
  630.  
  631. In article <l1ngvkINNiet@aludra.usc.edu> (comp.sys.mac.programmer), johnrobi@aludra.usc.edu (John Robinson) writes:
  632.  
  633. > Does anyone know of a reference which compares X-windows programming
  634. > to Macintosh programming?
  635.  
  636. There was an article in April 91 issue of MacTutor (vol 6 no 4) by Paul
  637. Hyman called "X Windows for Mac Programmers". Has sample code for a "Hello
  638. World" appl.
  639.  
  640.  
  641. Sak Wathanasin
  642. Network Analysis Limited
  643. 178 Wainbody Ave South, Coventry CV3 6BX, UK
  644.  
  645. uucp:      ...!uknet!nan!sw  Phone: (+44) 203 419996
  646. AppleLink: NAN.LTD           Internet: sw@network-analysis-ltd.co.uk
  647.  
  648. ---------------------------
  649.  
  650. From: ziff@zip.eecs.umich.edu (Brian Moore)
  651. Subject: Problem with C++ example code
  652. Date: 22 May 92 16:05:57 GMT
  653. Organization: University of Michigan EECS Dept., Ann Arbor, MI
  654.  
  655. I was wondering if anyone could help me out with this problem.  I am
  656. using the 'Elements of C++ Macintosh Programming' book by Dan Weston.
  657. When I tried to type in the example code for the TApp object, the compiler
  658. gave me an error about 
  659.      
  660.      File "TApp.h"; line 149 # error:  function returning array
  661.  
  662. The declaration from the header file looks like this.
  663.  
  664.      virtual SFTypeList GetFileTypesList(void){ return (SFTypeList )nil; }
  665.  
  666. Which is exactly how it shown in the book.  Now I know you can't return an
  667. array from a function like this, but since this is an example program I was
  668. thinking maybe I'm missing something.  Is anybody out there who used this
  669. book and remembers how it is supposed to look.  I am using MPW 3.2.2 with
  670. MPW C++ 3.2 from the ETO 7 CD.
  671.  
  672. On a related note, I remember there being something on the net that had 
  673. the source code for this book for Think C or MPW ( don't remember which )
  674. I tried to use Archie to find it but it did't come back with it.  I
  675. think it was called ElofC++Prog.hqx or something like that.  Does anybody
  676. have this or know where I can get it?
  677.  
  678.  
  679. Thanks,
  680. Brian Moore
  681. ziff@eecs.umich.edu
  682.  
  683. +++++++++++++++++++++++++++
  684.  
  685. From: ksand@apple.com (Kent Sandvik)
  686. Date: 22 May 92 20:43:11 GMT
  687. Organization: MacDTS Mongols
  688.  
  689. In article <1992May22.160557.26544@zip.eecs.umich.edu>, ziff@zip.eecs.umich.edu
  690. (Brian Moore) writes:
  691. >      File "TApp.h"; line 149 # error:  function returning array
  692. > The declaration from the header file looks like this.
  693. >      virtual SFTypeList GetFileTypesList(void){ return (SFTypeList )nil; }
  694. > Which is exactly how it shown in the book.  Now I know you can't return an
  695. > array from a function like this, but since this is an example program I was
  696. > thinking maybe I'm missing something. 
  697.  
  698. Arrays could be very costly anyway, so pass a pointer or reference back from 
  699. the call.
  700. - --
  701.                                               Cheers, Kent
  702.  
  703.  
  704. ---------------------------
  705.  
  706. From: alana@sisters.cs.uoregon.edu (Alan Akins)
  707. Subject: Technical Notes
  708. Organization: Somewhere Over the Rainbow, in a little town in the Willamette 
  709. Date: Sat, 23 May 1992 19:09:34 GMT
  710.  
  711. I am one of those people who didn't have access to ftp not long ago, so I took
  712. a subscription to the DTS Technical Notes for the Mac.  I received March just 
  713. fine, but have not yet received the May mailing (it is bi-monthly, right?).
  714.  
  715. Has anyone who subscribes received theirs? or knows why we haven't gotten them
  716. yet?
  717.  
  718. tank-u
  719. Alan
  720.  
  721. - -- 
  722. *                                          | Alan Akins: alana@cs.uoregon.edu *
  723. *       "Forests aren't wheatfields,       | University of Oregon          *
  724. *     just as a radio isn't             | Department of Computer and       *
  725. *               a toaster with words."     |     Information Sciences          *
  726.  
  727. +++++++++++++++++++++++++++
  728.  
  729. From: andyp@treehouse.UUCP (Andy Peterman)
  730. Date: 24 May 92 07:39:37 GMT
  731. Organization: The Treehouse
  732.  
  733. In article <1992May23.190934.12024@cs.uoregon.edu> alana@sisters.cs.uoregon.edu (Alan Akins) writes:
  734. - ->I am one of those people who didn't have access to ftp not long ago, so I took
  735. - ->a subscription to the DTS Technical Notes for the Mac.  I received March just 
  736. - ->fine, but have not yet received the May mailing (it is bi-monthly, right?).
  737. - ->
  738. - ->Has anyone who subscribes received theirs? or knows why we haven't gotten them
  739. - ->yet?
  740.  
  741. I called them (APDA) Friday wondering about the same thing.  He said
  742. that they were still putting together the printed version for mailing,
  743. but did not say when they would go out.  Sounds like it may be a few
  744. weeks yet :-(.
  745.  
  746. - -- 
  747. Andy Peterman                       
  748. treehouse!andyp@gvgpsa.gvg.tek.com  
  749. (916) 273-4569                      
  750.  
  751. ---------------------------
  752.  
  753. From: greeny@top.cis.syr.edu (J. S. Greenfield)
  754. Subject: PBHCopyFile equivalent for non-shared environments?
  755. Date: 23 May 92 19:04:09 GMT
  756. Organization: Syracuse University, CIS Dept.
  757.  
  758. Howdy folks.  I was just wondering if there is a procedure call analogous to
  759. PBHCopyFile that works for non-shared environments.  I haven't yet found
  760. anything in IM.
  761.  
  762. Incidentally, has anybody noticed that in IM V, the description of the
  763. procedure call for PBHCopyFile specifies that there is a field in the
  764. parameter block called ioFileName?  However, there is no such field name
  765. defined in the data structure, and THINK Pascal 4.0.1 flags the field as
  766. undeclared.
  767.  
  768. What gives?  Am I missing something?
  769.  
  770. Email or post replies.  Thanks for any help.
  771.  
  772. - -- 
  773. J. S. Greenfield                                         greeny@top.cis.syr.edu
  774. (I like to put 'greeny' here, 
  775. but my d*mn system wants a 
  776. *real* name!)                        "What's the difference between an orange?"
  777.  
  778. +++++++++++++++++++++++++++
  779.  
  780. From: kpmiller@uokmax.ecn.uoknor.edu (Kent P Miller)
  781. Date: 24 May 92 22:16:21 GMT
  782. Organization: Engineering Computer Network, University of Oklahoma, Norman, OK, USA
  783.  
  784. In article <1992May23.150409.11981@newstand.syr.edu> greeny@top.cis.syr.edu (J. S. Greenfield) writes:
  785. >Incidentally, has anybody noticed that in IM V, the description of the
  786. >procedure call for PBHCopyFile specifies that there is a field in the
  787. >parameter block called ioFileName?  However, there is no such field name
  788. >defined in the data structure, and THINK Pascal 4.0.1 flags the field as
  789. >undeclared.
  790. Greeny,
  791.  
  792. That has got to be the most poorly documented routine in the IM world!  
  793.  
  794. Anyway, the ioFileName should really be ioNewName.  The other paremeters
  795. don't work like you would expect (at least not me!).
  796.  
  797. Here's how to make it work:
  798.  
  799.         with pb3 do
  800.             begin
  801.                 ioCompletion := nil;
  802.                 ioNamePtr := @u;
  803.                 ioVRefNum := pb.iovrefnum;
  804.                 ioDstVRefNum := pb.iovrefnum;
  805.                 ioNewName := nil;
  806.                 ioCopyName := @t;
  807.                 ioNewDirID := pb2.ioFLParID;
  808.                 ioDirID := pb2.ioFLParID;
  809.             end;
  810.         dupeFile := PBHCopyFile(@pb3, false);
  811.  
  812. the pb2 was filled in with PBGetCatInfo on the dest file (I think).
  813.  
  814. Good luck!
  815.  
  816.  
  817. - -- 
  818. - -----------------------
  819. Kent Miller
  820. kpmiller@uokmax.ecn.uoknor.edu
  821. - -----------------------
  822.  
  823. ---------------------------
  824.  
  825. Subject: what's an OO-OS?
  826. From: tmaehl@vax1.umkc.edu
  827. Date: 24 May 92 16:49:13 CST
  828. Organization: University of Missouri-Kansas City
  829.  
  830. In article <1992May22.012419.27017@mtxinu.COM>, larrym@mtxinu.COM (Larry Meyer - mac weenie) writes:
  831. >... does anyone out there have any idea what an 
  832. > object oriented operating system is? If so, please tell me! 
  833.      
  834.  
  835. One can sure speculate. Hopefully one where I can drop in my
  836. own file system, plug in my own display system, plop down my own
  837. memory manager, stick in my own process scheduler, ...
  838.  
  839. Especially nice would be dynamic binding of those objects, so
  840. I wouldn't have to write a *new* file system, but could add to
  841. the current file system's functionality in an otherwise transparent
  842. way.
  843.  
  844.  
  845. Jonathan/tmaehl@vax1.umkc.edu
  846.  
  847. ---------------------------
  848.  
  849. From: ava@bcrka486.bnr.ca (Anthony VanAlphen 1572587)
  850. Subject: SFGetFile quick question!!!
  851. Organization: Bell Northern Research, Ottawa
  852. Date: Mon, 25 May 1992 16:51:53 GMT
  853.  
  854. If SFGetFile returns the fName and the vRefNum how can I convert this
  855. to a ":" delimited filename ie AVA:Desktop:foldera:fileb so that I can
  856. pass this expression to a STDIO fopen function.
  857. - --
  858. - -----------------------------------------------------
  859. Anthony Van Alphen       
  860. Bell-Northern Research       Phone:    (613) 763-5101
  861. P.O. Box 3511 Stn. C.        Fax:      (613) 763-7155
  862. Ottawa, Ontario K1Y 4H7      Internet: ava@bnr.ca
  863. - -----------------------------------------------------
  864.  
  865. +++++++++++++++++++++++++++
  866.  
  867. From: kpmiller@uokmax.ecn.uoknor.edu (Kent P Miller)
  868. Organization: Engineering Computer Network, University of Oklahoma, Norman, OK, USA
  869. Date: Mon, 25 May 1992 20:45:04 GMT
  870.  
  871. In article <1992May25.165153.16647@bcrka451.bnr.ca> ava@bcrka486.bnr.ca (Anthony VanAlphen 1572587) writes:
  872. >If SFGetFile returns the fName and the vRefNum how can I convert this
  873. >to a ":" delimited filename ie AVA:Desktop:foldera:fileb so that I can
  874. >pass this expression to a STDIO fopen function.
  875. Sorry to post twice in one day, but I answered this question a few weeks
  876. ago and since then I have found a bug in the code I posted.  The code worked
  877. fine for filenames on local volumes, but had a problem with shared volumes.
  878.  
  879. I got these parameters from a StandardGetFile (returns an FSSpec) but it
  880. should work under system 6 SFReply.  
  881.  
  882.   function GetFullPath (name: str32; parID: integer; vRefNum: integer): str255;
  883.    var
  884.     tempName, thePath, comppath: Str255;
  885.     vParams: CInfoPBRec;
  886.     theError, theErr: OSerr;
  887.     i: integer;
  888.     pb: HParamBlockRec;
  889.   begin
  890.    thePath := '';
  891.    tempName := '';
  892.    with vParams do
  893.     begin
  894.      ioCompletion := nil;
  895.      ioNamePtr := @tempName;
  896.      ioVRefNum := vRefNum;
  897.      ioFDirIndex := -1;
  898.      ioDrDirID := parID;
  899.      repeat
  900.       theError := PBGetCatInfo(@vParams, FALSE);
  901.       if (theError = noErr) then
  902.        begin
  903.        pb.ioNamePtr := @tempname;
  904.        pb.ioVRefnum := parID;
  905.        pb.ioFileID := ioDRParID;
  906.        theErr := PBResolveFileIDRef(@pb, false);
  907.        if theErr = noErr then
  908.          ioDRDirID := pb.ioSrcDirID
  909.        else
  910.           ioDRDirID := ioDRParID;
  911.        thePath := concat(tempName, ':', thePath);
  912.        tempName := '';
  913.        end;
  914.      until (theError <> noErr);
  915.      tempName := concat(thePath, name);
  916.      GetFullPath := tempName;
  917.     end;
  918.   end;
  919. - -- 
  920. - -----------------------
  921. Kent Miller
  922. kpmiller@uokmax.ecn.uoknor.edu
  923. - -----------------------
  924.  
  925. ---------------------------
  926.  
  927. From: spolsky@teal.csn.org (Steven Polsky)
  928. Subject: Pascal stuff for sale
  929. Date: 12 May 92 02:01:01 GMT
  930. Organization: Colorado SuperNet, Inc.
  931.  
  932.  
  933. I have the following PASCAL software, books, and disks for sale:
  934. - ---------------------------------------------------------
  935. IBM SOFTWARE
  936. - -----------------------------------
  937. Turbo Pascal Professional v6.0
  938. mail order $ 209 + shipping
  939. my price $150 incl shipping
  940. - ------------------------------------
  941. Turbo Pascal for Windows
  942. mail order price $169 + shipping
  943. my price $125 incl shipping
  944. - ------------------------------------
  945. MACINTOSH SOFTWARE
  946. - ------------------------------------
  947. THINK Pascal v4.0  
  948. mail order $165 + shipping
  949. my price $125 incl shipping
  950. - ------------------------------------
  951. Just Enough Pascal
  952. free with purchase of THINK Pascal
  953. - ------------------------------------
  954. PASCAL BOOKS AND DISKS
  955. - ------------------------------------
  956. Macintosh Pascal Programming Primer,
  957. Volume 1 including disk
  958. reg. price $45
  959. my price $25 incl shipping
  960. - ------------------------------------
  961. Object-Oriented Programming Power
  962. For THINK Pascal Programmers
  963. reg. price $40
  964. my price $25 incl shipping
  965. - -------------------------------------
  966. Oh! Pascal! second edition and
  967. THINK Pascal supplement
  968. reg. price $37
  969. my price $20 incl shipping
  970. - -------------------------------------
  971.  
  972. send replies via e-mail or phone.
  973.  
  974. Steven Polsky
  975. voice mail: 303-893-0123
  976.  
  977. +++++++++++++++++++++++++++
  978.  
  979. From: spolsky@teal.csn.org (Steven Polsky)
  980. Date: 25 May 92 22:40:50 GMT
  981. Organization: Colorado SuperNet, Inc.
  982.  
  983.  
  984. I have the following PASCAL software, books, and disks for sale:
  985. - ---------------------------------------------------------
  986. MACINTOSH SOFTWARE
  987. - ------------------------------------
  988. THINK Pascal v4.0  
  989. mail order $165 + shipping
  990. my price $125 incl shipping
  991. - ------------------------------------
  992. Just Enough Pascal
  993. free with purchase of THINK Pascal
  994. - ------------------------------------
  995. PASCAL BOOKS AND DISKS
  996. - ------------------------------------
  997. Macintosh Pascal Programming Primer,
  998. Volume 1 including disk
  999. reg. price $45
  1000. my price $25 incl shipping
  1001. - ------------------------------------
  1002. Object-Oriented Programming Power
  1003. For THINK Pascal Programmers
  1004. reg. price $40
  1005. my price $25 incl shipping
  1006. - -------------------------------------
  1007. Oh! Pascal! second edition and
  1008. THINK Pascal supplement
  1009. reg. price $37
  1010. my price $20 incl shipping
  1011. - -------------------------------------
  1012.  
  1013. send replies via e-mail or phone.
  1014.  
  1015. Steven Polsky
  1016. spolsky@csn.org
  1017. voice mail: 303-893-0123
  1018.  
  1019. ---------------------------
  1020.  
  1021. From: orpheus@reed.edu (P. Hawthorne)
  1022. Subject: A Couple of Strange Things About Think Pascal 4.01
  1023. Date: 18 May 92 23:38:06 GMT
  1024. Organization: Reed College, Portland OR
  1025.  
  1026.  
  1027.     I just spent a fair amount of time tracking down a bug in a Think
  1028. Pascal project that would seem to be the fault of Think Pascal itself.
  1029. Perhaps not surprisingly, it has to do with boolean variables. What
  1030. surprises me is that I actually found and stamped out the little beasty...
  1031. Thank the stars for the Think Pascal debugging environment!
  1032.  
  1033.     I had already discovered some trivial problems with autoscrolling
  1034. source windows, cancelling out of some dialogs with command dot, and some
  1035. minor unrecoverable heap fragmentation. Since they did not ultimately
  1036. affect the final product, I chose to grin and bear it.
  1037.     (Actually, I am still having some problems with Think Pascal source
  1038. and debugging windows confusing my floating window code all of a sudden
  1039. after upgrading to 4.01, but the burden of correction is probably mine on
  1040. that one.  The windowKinds must have gotten changed or something. Either
  1041. that or Pascal isn't catching mouseDown events during testing quite
  1042. correctly these days.)
  1043.  
  1044.     However, problems began to appear that I have tracked down to an
  1045. object which maintains an array of booleans. It worked perfectly before
  1046. updating to version 4.01.
  1047.     While I may be mistaken and I hope I do not have to eat my hat, I
  1048. seem to recall that the size of a boolean was 2 bytes before version 4.01.
  1049. Now, not only does the SizeOf routine return a value of 1 byte, but there
  1050. has been a very subtle bug scurrying around my graph traversal code which
  1051. has nothing to do with my code as far as I can tell. I do my development on
  1052. an SE/30, and should not be having any problems with using an odd address,
  1053. so that shouldn't be it.
  1054.     The new size of booleans should be cool, because the array object
  1055. takes the size of the items that it keeps from the SizeOf routine and can
  1056. cope with any size. It gets and sets the value of each item in the array
  1057. with solid memory copying code that I have verified. I have even resorted
  1058. to, horror of horrors, using BlockMove just to be sure.
  1059.  
  1060.     Is this a known bug? I have switched the code in question from
  1061. booleans to integers, and it works just swell. I can probably recreate the
  1062. bug if necessary, but would like to know if it has bitten anyone else...
  1063.     Or, alternately, whether it has to do with the phase of the moon
  1064. and my shoe size and is really my fault after all.
  1065.  
  1066.     Theus (orpheus@reed.edu)
  1067.  
  1068. +++++++++++++++++++++++++++
  1069.  
  1070. From: siegel@world.std.com (Rich Siegel)
  1071. Date: 19 May 92 01:46:38 GMT
  1072. Organization: GCC Technologies
  1073.  
  1074. In article <1992May18.233806.10154@reed.edu> orpheus@reed.edu (P. Hawthorne) writes:
  1075. >    While I may be mistaken and I hope I do not have to eat my hat, I
  1076. >seem to recall that the size of a boolean was 2 bytes before version 4.01.
  1077.  
  1078. Heinz 57 sauce goes well with felt, straw, or leather. The size of a Boolean
  1079. is, and always has been, one (1) byte.
  1080.  
  1081. R.
  1082.  
  1083.  
  1084. - -- 
  1085. - -----------------------------------------------------------------------
  1086. Rich Siegel                              Internet: siegel@world.std.com
  1087. Software Engineer, Quickdraw Group
  1088. GCC Technologies
  1089.  
  1090. +++++++++++++++++++++++++++
  1091.  
  1092. From: jpugh@apple.com (Jon Pugh)
  1093. Date: 23 May 92 05:29:24 GMT
  1094. Organization: Apple Computer, Inc.
  1095.  
  1096. In article <BoH69r.HuE@world.std.com>, siegel@world.std.com (Rich Siegel) writes:
  1097. > In article <1992May18.233806.10154@reed.edu> orpheus@reed.edu (P. Hawthorne) writes:
  1098. > >    While I may be mistaken and I hope I do not have to eat my hat, I
  1099. > >seem to recall that the size of a boolean was 2 bytes before version 4.01.
  1100. > Heinz 57 sauce goes well with felt, straw, or leather. The size of a Boolean
  1101. > is, and always has been, one (1) byte.
  1102.  
  1103. The trick is that if you pass a Boolean, it puts 2 bytes on the stack
  1104. to keep the stack word-aligned.  This makes Booleans _appear_ to be two bytes
  1105. long.  Records can also cause this sort of alignment to occur.
  1106.  
  1107. Jon
  1108.  
  1109. +++++++++++++++++++++++++++
  1110.  
  1111. From: orpheus@reed.edu (P. Hawthorne)
  1112. Date: 25 May 92 09:30:59 GMT
  1113. Organization: Reed College, Portland, Oregon
  1114.  
  1115.  
  1116.   orpheus@reed.edu (P. Hawthorne) writes:
  1117. : While I may be mistaken and I hope I do not have to eat my hat, I seem to
  1118. : recall that the size of a boolean was 2 bytes before version 4.01.
  1119.  
  1120.   siegel@world.std.com (Rich Siegel) writes:
  1121. : Heinz 57 sauce goes well with felt, straw, or leather. The size of a Boolean
  1122. : is, and always has been, one (1) byte.
  1123.  
  1124.   jpugh@apple.com (Jon Pugh) writes:
  1125. : The trick is that if you pass a Boolean, it puts 2 bytes on the stack to
  1126. : keep the stack word-aligned.  This makes Booleans _appear_ to be two bytes
  1127. : long.  Records can also cause this sort of alignment to occur.
  1128.  
  1129.   I'm afraid I've already eaten the hat, but thanks for the vindication, Jon.
  1130. Solved the problem by using a bit vector rather than a boolean array, which
  1131. was my original intention anyway.
  1132.  
  1133.   One of the other things I mentioned has been straightened out, too. I've
  1134. finally gotten a setjmp/longjmp implemented that's getting along with the
  1135. debugging environment in Think Pascal.
  1136.  
  1137.   That was right before something blew away the extents b-tree header on my
  1138. hard drive today. No rest for the weary...
  1139.  
  1140.   Theus (orpheus@reed.edu)
  1141.  
  1142. ---------------------------
  1143.  
  1144. End of C.S.M.P. Digest
  1145. **********************
  1146.